package com.hsy.crm.web.web.system;

import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.cm.Unified;
import com.hsy.crm.web.domain.entity.Print;
import com.hsy.crm.web.domain.vo.print.PrintInsertVo;
import com.hsy.crm.web.domain.vo.print.PrintPageVo;
import com.hsy.crm.web.service.impl.PrintService;
import com.hsy.crm.web.web.BaseAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/print")
public class PrintAction extends BaseAction {

    @Autowired
    PrintService printService;

    @RequestMapping("/insert")
    public String insert(PrintInsertVo printInsertVo) {
        return Response.body(printService.insertPrint(printInsertVo));
    }

    @RequestMapping("/update")
    public String update(PrintInsertVo printInsertVo) {
        return Response.body(printService.updatePrint(printInsertVo));
    }

    @RequestMapping("/get")
    public String get(Print print) {
        return Response.body(printService.getPrint(print));
    }

    @RequestMapping("/delete")
    public String delete(Print print) {
        return Response.body(printService.deletePrint(print));
    }

    @RequestMapping("/setDefault")
    public String setDefault(Print print) {
        return Response.body(Unified.newInstance(printService.setDefault(print)));
    }

    @RequestMapping("/page")
    public String page(PrintPageVo printPageVo) {
        return Response.body(printService.page(printPageVo));
    }

}
